F/OSS Comics

8. The Origins of Unix and the C Language

Posted on Sep 4, 2023

In the 1960's, the Incompatible Timesharing System (ITS) was being heavily developed at MIT. Meanwhile, at another location on the east coast of the United States, there was another lab with the same hacker spirit: AT&T Bell Laboratories.

The groundbreaking Unix and C language, which would go on to change the world, were being developed.

MIT vs. Bell Lab.

"I feel the force somewhere…"

Coincidentally, the people who were working on Multics were also involved in developing ITS and Unix: MIT folks started ITS, and Ken Thompson along with Dennis Ritchie and Joe Ossanna from Bell Labs created Unix.

"I think we need to step away from the Multics project now."
"Yeah, the development time has become way longer than we expected."

The Multics project began in 1964, but due to the large code size and complexity, the schedule fell far behind Bell Labs' expectations.

"Overdesigned and overbuilt and over everything."
"It was close to unusable[1]"

In 1969, Bell Lab. pulled out of the development of Multics.

“We’re leaving because we can't meet our schedule.”

Based on his experience developing Multics, Ken Thompson creates a new operating system by himself at Bell Labs.

“Dennis, I'm building a new operating system, taking some ideas from Multics. I'm making it smaller and simpler.”
“That’s a good idea. Shall I join you?”

Ken Thompson reimplemented many of the key features he had developed in Multics in Unix.

“I can't make something out of nothing”

He adapted the file system he had already implemented in Multics in Unix on the PDP-7. Dennis Richie, Joe Ossanna, Rudd Canaday later joined him in the development. Once the development was well underway, a team was organized and they began implementing the operating system features we use today, such as the filesystem, process model, device files, and command line interpreter, for the first time on the PDP-7.

“First of all, I'm working on a file system. How about we call it Unix?”
“How about mapping devices to files?”

Then, PDP-11 was introduced, which differed in CPU instructions from the PDP-7.

"Ken, we have a new PDP-11, why don't we port Unix to it?"
"That's a great idea, but the problem is that the CPU instructions are different, so we'll have to re-write the Unix code with the PDP-11 assembly language."

“Wow, I finally finished porting!"
"But we can't rewrite the Unix code in assembly every time we buy a new computer, right?

“Dennis, shall we rewrite Unix in the B language? Now we are able to build an OS kernel without assembly."

"Maybe we can port Unix to PDP-11 using the B language"  

B language was also developed for use in Multics by Ken Thompson and Dennis Ritchie in 1969.

"First we need to port the B language to the PDP-11, but there's a problem."

In 1971, Dennis Ritchie added a character type to the B language and rewrote the compiler code to generate PDP-11 machine code[3].

“Dennis, how's the B language porting going?”
“There are a lot of issues, first of all, it’s hard to access the character data type on PDP-11.”

"Haha, why don't you completely update the B language this time?”
"I might have to rewrite it from scratch."

In 1973, basic functionalities were complete, and it was called C, which was just the next version of B.

“How about calling it C?”
"Sounds good"

Dennis Richie began rewriting Unix in C that same year.

"Hmm, I don't have to code in assembly anymore"

Dennis added the structure type to the C language to define the user's custom data. Now, the C language is powerful enough to write Unix kernels.

Although Unix and C were created in a short period of time by Ken Thompson and Dennis Richie, most computers, including cell phones, still run on OS based on Unix today. In addition, operating system kernels are still developed in C today.

Readings from the Computer History Museum

  1. David C. Brock, the earliest unix code: an anniversary source code release, CHM

References

  1. Multics, wikipedia
  2. Unix, wikipedia
  3. History of Unix, wikipedia
  4. The Development of the C Language bell-labs.com
  5. The Evolution of the Unix Time-sharing System www.read.seas.harvard.edu/~kohler